package com.niit.scs.server.repository;

import com.niit.scs.server.doc.EsContentInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EsContentInfoRepository extends ElasticsearchRepository<EsContentInfo,Long> {
    @Query(" {" +
        "    \"multi_match\": {" +
        "      \"query\": \"?0\"," +
        "      \"fields\": [\"contenttext\",\"contentauthor\"]" +
        "    }" +
        "  }")
    Page<EsContentInfo> findByContenttext(String text,Pageable pageable);
}
